(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/scripts/huochai/lanuch.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, '0236aQh8wFFwKaTCjJs1byK', 'lanuch', __filename);
// scripts/huochai/lanuch.js

'use strict';

cc.Class({
    extends: cc.Component,

    properties: {
        display: cc.Sprite
    },

    start: function start() {
        this._isShow = false;
        this.tex = new cc.Texture2D();
        //var openDataContext = wx.getOpenDataContext();
        //var sharedCanvas1 = openDataContext.canvas;
        if (sharedCanvas) {
            sharedCanvas.width = cc.game.canvas.width * 2;
            sharedCanvas.height = cc.game.canvas.height * 2;
        }
        //sharedCanvas.width = 720;

        //sharedCanvas.height = 1280;
        //let openDataContext = wx.getOpenDataContext();
        //let sharedCanvas1 = openDataContext.canvas;
        //cc.log('------------------》');
    },


    // use this for initialization
    onLoad: function onLoad() {

        /*
        this.display.node.on(cc.Node.EventType.TOUCH_END, function (event) {
            //cc.log('------------------》'+event.touch._point.x);
            //cc.log('------------------》'+event.touch._point.y);
            cc.log('------------------》');
        }, this.display);
        //this.display.on(cc.Node.EventType.TOUCH_END, function (event) {
        //}, this);*/
    },

    onClick: function onClick() {
        cc.log('------------------》');
        this._isShow = !this._isShow;
        // 发消息给子域
        wx.postMessage({
            message: 'Show'
        });
    },
    _updaetSubDomainCanvas: function _updaetSubDomainCanvas() {
        if (!this.tex) {
            return;
        }
        //cc.log('-----------》'+window.sharedCanvas.width+'-----'+window.sharedCanvas.height);
        //cc.log('-----------》');
        this.tex.initWithElement(sharedCanvas);
        this.tex.handleLoadedTexture();
        this.display.spriteFrame = new cc.SpriteFrame(this.tex);
    },
    update: function update() {
        this._updaetSubDomainCanvas();
    }
});

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=lanuch.js.map
        